VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "EstadoPagador"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
''  EstadoPagador.cls
''  Implementation of the table Class EstadoPagador
''  Generated by Enterprise Architect
''  Created on:      15-Abr-2009 08:07:09 p.m.
''  Original author: Administrador
''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Aca se guardan los posibles estados de un cliente, sea deudor, dead o mansalva

Private rsEstadoPagador As New ADODB.Recordset

Private m_estCodigo As Integer
Private m_estDescripcion As String

Public Property Get estCodigo() As Integer
    estCodigo = m_estCodigo
End Property
Public Property Let estCodigo(ByVal inNew As Integer)
    If (m_estCodigo = inNew) Then Exit Property
    m_estCodigo = inNew
End Property

Public Property Get estDescripcion() As String
    estDescripcion = m_estDescripcion
End Property
Public Property Let estDescripcion(ByVal inNew As String)
    If (m_estDescripcion = inNew) Then Exit Property
    m_estDescripcion = inNew
End Property

Public Sub abrirEstadoPagador()
    If rsEstadoPagador.State <> adStateClosed Then
        rsEstadoPagador.Close
    End If
    rsEstadoPagador.Open "select * from estadoPagador", conexion.cn, adOpenKeyset, adLockOptimistic
End Sub

Public Sub cargarEstadoPagador()
    If Not rsEstadoPagador.EOF Then
        m_estCodigo = rsEstadoPagador.Fields("estCodigo")
        m_estDescripcion = rsEstadoPagador.Fields("estDescripcion")
    End If
End Sub

Public Function primerEstadoPagador() As Boolean
    If Not (rsEstadoPagador.EOF And rsEstadoPagador.BOF) Then
        rsEstadoPagador.MoveFirst
        primerEstadoPagador = True
        cargarEstadoPagador
    Else
        primerEstadoPagador = False
    End If
End Function

Public Function siguienteEstadoPagador() As Boolean
    rsEstadoPagador.MoveNext
    If Not rsEstadoPagador.EOF Then
        siguienteEstadoPagador = True
        cargarEstadoPagador
    Else
        siguienteEstadoPagador = False
    End If
End Function

Public Function anteriorEstadoPagador() As Boolean
    rsEstadoPagador.MovePrevious
    If Not rsEstadoPagador.BOF Then
        anteriorEstadoPagador = True
        
        cargarEstadoPagador
    Else
        anteriorEstadoPagador = False
    End If
End Function

Public Function ultimoEstadoPagador() As Boolean
    If Not (rsEstadoPagador.EOF And rsEstadoPagador.BOF) Then
        rsEstadoPagador.MoveLast
        ultimoEstadoPagador = True
        cargarEstadoPagador
    Else
        ultimoEstadoPagador = False
    End If
End Function

Public Function nuevoEstadoPagador() As Boolean
    Dim rsEstadoPagadorAux As ADODB.Recordset
    Dim strInsert As String
    
    strInsert = "Insert into (estCodigo, estDescripcion) values (" + estCodigo + ",'" _
    & estDescripcion + "')"
    
    rsEstadoPagadorAux.Open strInsert, conexion.cn, adOpenKeyset, adLockOptimistic

End Function
